home *** CD-ROM | disk | FTP | other *** search
- folderProjects = "Team Projects";
-
- function GetTime() {
- var dt = new Date();
- //var dt = tmpdate;
- var def = dt.getTimezoneOffset()/60;
- var gmt = (dt.getHours() + def);
- //document.clock.local.value = (IfZero(dt.getHours()) + ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds()));
- var ending = ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds());
- var rome =check24(((gmt + 1) > 24) ? ((gmt + 1) - 24) : (gmt + 1));
- //document.clock.rome.value = (IfZero(rome) + ending);
- var isr =check24(((gmt + 2) > 24) ? ((gmt + 2) - 24) : (gmt + 2));
- //document.clock.Israel.value = (IfZero(isr) + ending);
- var msw =check24(((gmt + 3) > 24) ? ((gmt + 3) - 24) : (gmt + 3));
- //document.clock.msw.value = (IfZero(msw) + ending);
- var baku =check24(((gmt + 4) > 24) ? ((gmt + 4) - 24) : (gmt + 4));
- //document.clock.baku.value = (IfZero(baku) + ending);
- var del =check24(((gmt + 5) > 24) ? ((gmt + 5) - 24) : (gmt + 5));
- //document.clock.del.value = (IfZero(del) + ending);
- var dh =check24(((gmt + 6) > 24) ? ((gmt + 6) - 24) : (gmt + 6));
- //document.clock.dh.value = (IfZero(dh) + ending);
- var kok =check24(((gmt +7 ) > 24) ? ((gmt +7 ) - 24) : (gmt + 7));
- //document.clock.kok.value = (IfZero(kok) + ending);
- var ho =check24(((gmt + 8) > 24) ? ((gmt + 8) - 24) : (gmt + 8));
- //document.clock.ho.value = (IfZero(ho) + ending);
- var tky =check24(((gmt + 9) > 24) ? ((gmt + 9) - 24) : (gmt + 9));
- //document.clock.tky.value = (IfZero(tky) + ending);
- var sdn =check24(((gmt + 10) > 24) ? ((gmt + 10) - 24) : (gmt + 10));
- //document.clock.sdn.value = (IfZero(sdn) + ending);
- var mag =check24(((gmt + 11) > 24) ? ((gmt + 11) - 24) : (gmt + 11));
- //document.clock.mag.value = (IfZero(mag) + ending);
- var wll =check24(((gmt + 12) > 24) ? ((gmt + 12) - 24) : (gmt + 12));
- //document.clock.wll.value = (IfZero(wll) + ending);
-
- var _GMT =check24(((gmt) > 24) ? ((gmt) - 24) : (gmt));
-
- var eniw =check24(((gmt + (24-12)) > 24) ? ((gmt + (24-12)) - 24) : (gmt + (24-12)));
- //document.clock.eniw.value = (IfZero(eniw) + ending);
- var sam =check24(((gmt + (24-11)) > 24) ? ((gmt + (24-11)) - 24) : (gmt + (24-11)));
- //document.clock.sam.value = (IfZero(sam) + ending);
- var haw =check24(((gmt + (24-10)) > 24) ? ((gmt + (24-10)) - 24) : (gmt + (24-10)));
- //document.clock.Hawaii.value = (IfZero(haw) + ending);
- var ala =check24(((gmt + (24-9)) > 24) ? ((gmt + (24-9)) - 24) : (gmt + (24-9)));
- //document.clock.alaska.value = (IfZero(ala) + ending);
- var pacif =check24(((gmt + (24-8)) >= 24) ? ((gmt + (24-8)) - 24) : (gmt + (24-8)));
- //document.clock.pacif.value = (IfZero(pacif) + ending);
- var mount =check24(((gmt + (24-7)) > 24) ? ((gmt + (24-7)) - 24) : (gmt + (24-7)));
- //document.clock.mount.value = (IfZero(mount) + ending);
- var center =check24(((gmt + (24-6)) > 24) ? ((gmt + (24-6)) - 24) : (gmt + (24-6)));
- //document.clock.center.value = (IfZero(center) + ending);
- var east =check24(((gmt + (24-5)) > 24) ? ((gmt + (24-5)) - 24) : (gmt + (24-5)));
- //document.clock.east.value = (IfZero(east) + ending);
- var atl =check24(((gmt + (24-4)) > 24) ? ((gmt + (24-4)) - 24) : (gmt + (24-4)));
- //document.clock.atl.value = (IfZero(atl) + ending);
- var bra =check24(((gmt + (24-3)) > 24) ? ((gmt + (24-3)) - 24) : (gmt + (24-3)));
- bra = (bra >= 24) ? bra - 24 : bra;
- //document.clock.bra.value = (IfZero(bra) + ending);
- var mid =check24(((gmt + (24-2)) > 24) ? ((gmt + (24-2)) - 24) : (gmt + (24-2)));
- mid = (mid >= 24) ? mid - 24 : mid;
- //document.clock.mid.value = (IfZero(mid) + ending);
- var azo =check24(((gmt + (24-1)) > 24) ? ((gmt + (24-1)) - 24) : (gmt + (24-1)));
- azo = (azo >= 24) ? azo - 24 : azo;
- //document.clock.azo.value = (IfZero(azo) + ending);
- tz = Math.round(document.clock.SelectedTZ.value);
- if (tz == 0)
- {
- document.clock.TZ.value = "Greenwich Mean Time (GMT)";
- document.clock._GMT.value = (IfZero(_GMT) + ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds()));
- }
- if (tz == 1)
- {
- document.clock.TZ.value = "Berlin, Rome (GMT+1)";
- document.clock._GMT.value = (IfZero(rome) + ending);
- }
- if (tz == 2)
- {
- document.clock.TZ.value = "Helsinki (GMT+2) ";
- document.clock._GMT.value = (IfZero(isr) + ending);
- }
- if (tz == 3)
- {
- document.clock.TZ.value = "Moscow (GMT+3) ";
- document.clock._GMT.value = (IfZero(msw) + ending);
- }
- if (tz == 4)
- {
- document.clock.TZ.value = "Baku (GMT+4) ";
- document.clock._GMT.value = (IfZero(baku) + ending);
- }
- if (tz == 5)
- {
- document.clock.TZ.value = "New Delhi (GMT+5) ";
- document.clock._GMT.value = (IfZero(del) + ending);
- }
- if (tz == 6)
- {
- document.clock.TZ.value = "Almaty, Dhaka (GMT+6) ";
- document.clock._GMT.value = (IfZero(dh) + ending);
- }
- if (tz == 7)
- {
- document.clock.TZ.value = "Bangkok (GMT+7) ";
- document.clock._GMT.value = (IfZero(kok) + ending);
- }
- if (tz == 8)
- {
- document.clock.TZ.value = "Hong Kong, Singapore (GMT+8) ";
- document.clock._GMT.value = (IfZero(ho) + ending);
- }
- if (tz == 9)
- {
- document.clock.TZ.value = "Tokyo, Seoul (GMT+9) ";
- document.clock._GMT.value = (IfZero(tky) + ending);
- }
- if (tz == 10)
- {
- document.clock.TZ.value = "Sydney, Vladivostok (GMT+10) ";
- document.clock._GMT.value = (IfZero(sdn) + ending);
- }
- if (tz == 11)
- {
- document.clock.TZ.value = "Magadan (GMT+11) ";
- document.clock._GMT.value = (IfZero(mag) + ending);
- }
- if (tz == 12)
- {
- document.clock.TZ.value = "Wellington (GMT+12) ";
- document.clock._GMT.value = (IfZero(wll) + ending);
- }
- if (tz == 13)
- {
- document.clock.TZ.value = "Eniwetok (GMT-12) ";
- document.clock._GMT.value = (IfZero(eniw) + ending);
- }
- if (tz == 14)
- {
- document.clock.TZ.value = "Midway Island, Samoa (GMT-11) ";
- document.clock._GMT.value = (IfZero(sam) + ending);
- }
- if (tz == 15)
- {
- document.clock.TZ.value = "Hawaii (GMT-10) ";
- document.clock._GMT.value = (IfZero(haw) + ending);
- }
- if (tz == 16)
- {
- document.clock.TZ.value = "Alaska (GMT-9) ";
- document.clock._GMT.value = (IfZero(ala) + ending);
- }
- if (tz == 17)
- {
- document.clock.TZ.value = "Pacific Time (GMT-8) ";
- document.clock._GMT.value = (IfZero(pacif) + ending);
- }
- if (tz == 18)
- {
- document.clock.TZ.value = "Mountain Time (GMT-7) ";
- document.clock._GMT.value = (IfZero(mount) + ending);
- }
- if (tz == 19)
- {
- document.clock.TZ.value = "Central Time (GMT-6) ";
- document.clock._GMT.value = (IfZero(center) + ending);
- }
- if (tz == 20)
- {
- document.clock.TZ.value = "Eastern Time (GMT-5) ";
- document.clock._GMT.value = (IfZero(east) + ending);
- }
- if (tz == 21)
- {
- document.clock.TZ.value = "Atlantic Time (GMT-4) ";
- document.clock._GMT.value = (IfZero(atl) + ending);
- }
- if (tz == 22)
- {
- document.clock.TZ.value = "Brazilia (GMT-3) ";
- document.clock._GMT.value = (IfZero(bra) + ending);
- }
- if (tz == 23)
- {
- document.clock.TZ.value = "Mid-Atlantic (GMT-2) ";
- document.clock._GMT.value = (IfZero(mid) + ending);
- }
- if (tz == 24)
- {
- document.clock.TZ.value = "Azores (GMT-1)";
- document.clock._GMT.value = (IfZero(azo) + ending);
- }
-
- setTimeout("GetTime()", 1000);
- }
-
- function IfZero(num) {
- return ((num <= 9) ? ("0" + num) : num);
- }
-
- function check24(hour) {
- return (hour >= 24) ? hour - 24 : hour;
- }
-
- function ChangeTZ()
- {
- if (document.clock.SelectedTZ.value > 23)
- {
- var newtz = 0;
- }
- else
- {
- var newtz = Math.round(document.clock.SelectedTZ.value) + 1;
- }
- document.clock.SelectedTZ.value = newtz;
- tOutApp = window.external.OutlookApplication;
- tProjFolder = tOutApp.ActiveExplorer.CurrentFolder.Parent;
- if (tProjFolder.name == folderProjects) tProjFolder = tOutApp.ActiveExplorer.CurrentFolder;
- comadd.LocalTimePost(tProjFolder, newtz);
- GetTime();
- }
-